/*
 * Scene.h
 *
 *  Created on: 2010-09-17
 *      Author: michal
 */

#ifndef SCENE_H_
#define SCENE_H_

#include <vector>
//#include "../math/Vertex.h"
#include "Sphere.h"
#include "Plane.h"
#include "MetaballGroup.h"
#include "Light.h"
#include "Camera.h"

using namespace std;

class Scene
{
public:
	Scene();
	virtual ~Scene();

	// ========== TYPEDEFS ===========

	typedef vector<Light *>                  LightList;
	typedef vector<Light *>::iterator        LightIterator;
	typedef vector<Light *>::const_iterator  LightConstIterator;

	typedef vector<Object *>                 ObjectList;
	typedef vector<Object *>::iterator       ObjectIterator;
	typedef vector<Object *>::const_iterator ObjectConstIterator;

	typedef vector<Material *>               MaterialList;
	typedef vector<Material *>::iterator     MaterialIterator;


	// =========== METHODS ===========

	const vector<Sphere *> & GetSpheres() const { return _spheres; }
	Sphere * CreateSphere();

	const vector<Plane *> & GetPlanes() const { return _planes; }
	Plane * CreatePlane();

	const vector<MetaballGroup *> & GetMetaballGroups() const { return _metaballGroups; }
	MetaballGroup * CreateMetaballGroup();

	const LightList & GetLights() const { return _lights; }
	Light * CreateLight();

	const MaterialList & GetMaterials() const { return _materials; }
	Material * CreateMaterial();

	float GetFieldOfViewInRadians() const { return _fieldOfViewRad; }

	void SetAmbientColor(const Color & color) { _ambientColor = color; }
	const Color & GetAmbientColor() const { return _ambientColor; }

	Material * GetDefaultMaterial() const { return _defaultMaterial; }

	const Camera & GetCamera() const { return _camera; }
	Camera & GetEditableCamera() { return _camera; }

private:
	// =========== MEMBER FIELDS ==========

	Camera _camera;

	ObjectList _objects;
	LightList _lights;
	MaterialList _materials;

	// different kinds of primitives
	vector<Sphere *> _spheres;
	vector<Plane *> _planes;
	vector<MetaballGroup *> _metaballGroups;

	Material * _defaultMaterial;

	float _fieldOfViewRad;
	Color _ambientColor;
};

#endif /* SCENE_H_ */
